﻿
namespace SwtorCalculator {
    using System;
    using System.Threading;
    using System.Windows;
    using System.Windows.Input;
    using Talents;

    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window {
        //Thread thread;
        private MainWindow main;

        /// <summary>
        /// winClassChoose no-arg constructor
        /// </summary>
        public Window1() {
            InitializeComponent();
        }

        private void Window_MouseLeftButtonDown( object sender, MouseButtonEventArgs e ) {
            this.DragMove();
        }

        private void btnWarrior_Click( object sender, RoutedEventArgs e ) { /*warriorPopup.IsOpen = true;*/  }

        private void btnInquis_Click( object sender, RoutedEventArgs e ) { inquisPopup.IsOpen = true; }

        private void btnBounty_Click( object sender, RoutedEventArgs e ) { /*bountyPopup.IsOpen = true;*/ }

        private void btnAgent_Click( object sender, RoutedEventArgs e ) { /*agentPopup.IsOpen = true;*/ }

        private void btnTrooper_Click( object sender, RoutedEventArgs e ) { /*trooperPopup.IsOpen = true;*/ }

        private void btnSmuggler_Click( object sender, RoutedEventArgs e ) { /*smugglerPopup.IsOpen = true;*/ }

        private void btnKnight_Click( object sender, RoutedEventArgs e ) { /*knightPopup.IsOpen = true;*/ }

        private void btnConsular_Click( object sender, RoutedEventArgs e ) { /*consularPopup.IsOpen = true;*/ }
        
        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Assassin advance class
        /// </summary>
        private void btnAssassin_Click( object sender, RoutedEventArgs e ) {
            try {
                Character.ClassName = "Sith Inquisitor";
                Character.AdvanceClass = "Assassin";
                Character.IsRepublic = false;
                Character.CanDualWield = false;
                Character.isDualWield = true;
                Character.TalentSpec = new AssassinTalents();
                Character.Ability = new AssassinAbil();
                Character.Stat = new ConsularInquisitorStats();

                //thread = new Thread( () => loadDbleLightsabers() );
                //thread.Start();
                //thread = new Thread( () => loadNecks() );
                //thread.Start();
                //thread = new Thread( () => loadRings() );
                //thread.Start();
                //thread = new Thread( () => loadMods() );
                //thread.Start();
                main = new MainWindow();
                main.Show();
                this.Close();
            }
            catch( Exception ea ) {
                General.ErrorMessage( ea.Source.ToString(), ea.Message, ea.TargetSite.ToString(), ea.StackTrace );
            }
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Sorcerer advance class
        /// </summary>
        private void btnSorcerer_Click( object sender, RoutedEventArgs e ) {
            try {
                Character.ClassName = "Sith Inquisitor";
                Character.AdvanceClass = "Sorcerer";
                Character.IsRepublic = false;
                Character.CanDualWield = false;
                Character.isDualWield = false;
                Character.TalentSpec = new SorcererTalents();
                Character.Ability = new SorcererAbil();
                Character.Stat = new ConsularInquisitorStats();

                //thread = new Thread( () => loadLightsabers() );
                //thread.Start();
                //thread = new Thread( () => loadNecks() );
                //thread.Start();
                //thread = new Thread( () => loadRings() );
                //thread.Start();
                //thread = new Thread( () => loadMods() );
                //thread.Start();
                main = new MainWindow();
                main.Show();
                this.Close();
            }
            catch( Exception eb ) {
                General.ErrorMessage( eb.Source.ToString(), eb.Message, eb.TargetSite.ToString(), eb.StackTrace );
            }
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Juggernaut advance class
        /// </summary>
        private void btnJuggernaut_Click( object sender, RoutedEventArgs e ) {
            Character.ClassName = "Sith Warrior";
            Character.AdvanceClass = "Juggernaut";
            Character.IsRepublic = false;
            Character.CanDualWield = false;
            Character.isDualWield = false;
            //Character.TalentSpec = new 
            Character.Ability = new JuggernautAbil();
            Character.Stat = new KnightWarriorStats();

            //thread = new Thread( () => loadHeavyArmor() );
            //thread.Start();
            //thread = new Thread( () => loadMediumArmor() );
            //thread.Start();
            //thread = new Thread( () => loadLightsabers() );
            //thread.Start();
            //thread = new Thread( () => loadNecks() );
            //thread.Start();
            //thread = new Thread( () => loadRings() );
            //thread.Start();
            //thread = new Thread( () => loadMods() );
            //thread.Start();
            main = new MainWindow();
            main.Show();
            this.Close();
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Marauder advance class
        /// </summary>
        private void btnMarauder_Click( object sender, RoutedEventArgs e ) {
            Character.ClassName = "Sith Warrior";
            Character.AdvanceClass = "Marauder";
            Character.IsRepublic = false;
            Character.CanDualWield = true;
            Character.isDualWield = false;
            //Character.TalentSpec = new 
            Character.Ability = new MarauderAbil();
            Character.Stat = new KnightWarriorStats();

            ////thread = new Thread( () => loadMediumArmor() );
            ////thread.Start();
            ////thread = new Thread( () => loadLightsabers() );
            ////thread.Start();
            ////thread = new Thread( () => loadNecks() );
            ////thread.Start();
            ////thread = new Thread( () => loadRings() );
            ////thread.Start();
            ////thread = new Thread( () => loadMods() );
            ////thread.Start();
            main = new MainWindow();
            main.Show();
            this.Close();
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Mercenary advance class
        /// </summary>
        private void btnMercenary_Click( object sender, RoutedEventArgs e ) {
            Character.ClassName = "Bounty Hunter";
            Character.AdvanceClass = "Mercenary";
            //Character.TalentSpec = new 
            Character.IsRepublic = false;
            Character.CanDualWield = false;
            Character.isDualWield = false;
            Character.Ability = new MercenaryAbil();
            Character.Stat = new TrooperHunterStats();
            main = new MainWindow();
            main.Show();
            this.Close();
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Powertech advance class
        /// </summary>
        private void btnPowertech_Click( object sender, RoutedEventArgs e ) {
            Character.ClassName = "Bounty Hunter";
            Character.AdvanceClass = "Powertech";
            Character.IsRepublic = false;
            Character.CanDualWield = false;
            Character.isDualWield = false;
            //Character.TalentSpec = new 
            Character.Ability = new PowertechAbil();
            Character.Stat = new TrooperHunterStats();
            main = new MainWindow();
            main.Show();
            this.Close();
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Operative advance class
        /// </summary>
        private void btnOperative_Click( object sender, RoutedEventArgs e ) {
            Character.ClassName = "Imperial Agent";
            Character.AdvanceClass = "Operative";
            Character.IsRepublic = false;
            Character.CanDualWield = true;
            Character.isDualWield = false;
            //Character.TalentSpec = new 
            Character.Ability = new OperativeAbil();
            Character.Stat = new SmugglerAgentStats();
            main = new MainWindow();
            main.Show();
            this.Close();
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Sniper advance class
        /// </summary>
        private void btnSniper_Click( object sender, RoutedEventArgs e ) {
            Character.ClassName = "Imperial Agent";
            Character.AdvanceClass = "Sniper";
            Character.IsRepublic = false;
            Character.CanDualWield = false;
            Character.isDualWield = false;
            //Character.TalentSpec = new 
            Character.Ability = new SniperAbil();
            Character.Stat = new SmugglerAgentStats();
            main = new MainWindow();
            main.Show();
            this.Close();
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Guardian advance class
        /// </summary>
        private void btnGuardian_Click( object sender, RoutedEventArgs e ) {
            Character.ClassName = "Jedi Knight";
            Character.AdvanceClass = "Guardian";
            Character.IsRepublic = true;
            Character.CanDualWield = false;
            Character.isDualWield = false;
            //Character.TalentSpec = new 
            Character.Ability = new GuardianAbil();
            Character.Stat = new KnightWarriorStats();
            main = new MainWindow();
            main.Show();
            this.Close();
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Sentinel advance class
        /// </summary>
        private void btnSentinel_Click( object sender, RoutedEventArgs e ) {
            Character.ClassName = "Jedi Knight";
            Character.AdvanceClass = "Sentinel";
            Character.IsRepublic = true;
            Character.CanDualWield = true;
            Character.isDualWield = false;
            //Character.TalentSpec = new 
            Character.Ability = new SentinelAbil();
            Character.Stat = new KnightWarriorStats();
            main = new MainWindow();
            main.Show();
            this.Close();
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Sage advance class
        /// </summary>
        private void btnSage_Click( object sender, RoutedEventArgs e ) {
            Character.ClassName = "Jedi Consular";
            Character.AdvanceClass = "Sage";
            Character.IsRepublic = true;
            Character.CanDualWield = false;
            Character.isDualWield = false;
            //Character.TalentSpec = new 
            Character.Ability = new SageAbil();
            Character.Stat = new ConsularInquisitorStats();
            main = new MainWindow();
            main.Show();
            this.Close();
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Consular advance class
        /// </summary>
        private void btnShadow_Click( object sender, RoutedEventArgs e ) {
            Character.ClassName = "Jedi Consular";
            Character.AdvanceClass = "Shadow";
            Character.IsRepublic = true;
            Character.CanDualWield = false;
            Character.isDualWield = false;
            //Character.TalentSpec = new  
            Character.Ability = new ShadowAbil();
            Character.Stat = new ConsularInquisitorStats();
            main = new MainWindow();
            main.Show();
            this.Close();
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Commando advance class
        /// </summary>
        private void btnCommando_Click( object sender, RoutedEventArgs e ) {
            Character.ClassName = "Trooper";
            Character.AdvanceClass = "Commando";
            Character.IsRepublic = true;
            Character.CanDualWield = false;
            Character.isDualWield = false;
            //Character.TalentSpec = new 
            Character.Ability = new CommandoAbil();
            Character.Stat = new TrooperHunterStats();
            main = new MainWindow();
            main.Show();
            this.Close();
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Vanguard advance class
        /// </summary>
        private void btnVanguard_Click( object sender, RoutedEventArgs e ) {
            Character.ClassName = "Trooper";
            Character.AdvanceClass = "Vanguard";
            Character.IsRepublic = true;
            Character.CanDualWield = false;
            Character.isDualWield = false;
            //Character.TalentSpec = new 
            Character.Ability = new VanguardAbil();
            Character.Stat = new TrooperHunterStats();
            main = new MainWindow();
            main.Show();
            this.Close();
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Gunslinger advance class
        /// </summary>
        private void btnGunslinger_Click( object sender, RoutedEventArgs e ) {
            Character.ClassName = "Smuggler";
            Character.AdvanceClass = "Gunslinger";
            Character.IsRepublic = true;
            Character.CanDualWield = true;
            Character.isDualWield = false;
            //Character.TalentSpec = new 
            Character.Ability = new GunslingerAbil();
            Character.Stat = new SmugglerAgentStats();
            main = new MainWindow();
            main.Show();
            this.Close();
        }

        /// <summary>
        /// Set the class name string, create the class object, and load the appropriate
        /// items for the Scoundrel advance class
        /// </summary>
        private void btnScoundrel_Click( object sender, RoutedEventArgs e ) {
            Character.ClassName = "Smuggler";
            Character.AdvanceClass = "Scoundrel";
            Character.IsRepublic = true;
            Character.CanDualWield = false;
            Character.isDualWield = false;
            //Character.TalentSpec = new 
            Character.Ability = new GunslingerAbil();
            Character.Stat = new SmugglerAgentStats();
            main = new MainWindow();
            main.Show();
            this.Close();
        }

        private void loadLightArmor() {
            Thread.Sleep( 2000 ); // Placeholder
        }

        private void loadMediumArmor() {
            Thread.Sleep( 2000 ); // Placeholder
        }

        private void loadHeavyArmor() {
            Thread.Sleep( 2000 ); // Placeholder
        }

        private void loadLightsabers() {
            Thread.Sleep( 2000 ); // Placeholder
        }

        private void loadDbleLightsabers() {
            Thread.Sleep( 2000 ); // Placeholder
        }

        private void loadNecks() {
            Thread.Sleep( 2000 ); // Placeholder
        }

        private void loadRings() {
            Thread.Sleep( 2000 ); // Placeholder
        }

        private void loadMods() {
            Thread.Sleep( 2000 ); // Placeholder
        }
    }
}
